<template>
  <!-- PersonInfo 人员信息 -->
  <PageContainer>
    <view class="container">
      <Header title="人员信息" />
      <List :id="id" v-model="callback" />
      <img class="add" src="https://hb-saas.obs.cn-south-1.myhuaweicloud.com/mall/saas/icon/floatIcon/add-icon.png" alt="" @click="handleAdd" />
    </view>
  </PageContainer>
</template>

<script lang="ts" setup>
  /**  PersonInfo  人员信息 */
  import PageContainer from '@/components/PageContainer/index.vue';
  import Header from '@/components/Header/index.vue';
  import List from './components/List.vue';

  import { navigateTo, onLoad } from '@/router';
  import { ref } from 'vue';
  import { ApplyTypeEnum } from '@/enums/membershipEnum';

  const id = ref();
  const applyType = ref();
  onLoad<'PersonInfo'>((op) => {
    id.value = op.id;
    applyType.value = op.applyType;
  });

  let callback: () => void;

  const handleAdd = () => {
    navigateTo({ name: 'personAdd', options: { cocId: id.value, callback: callback } });
  };
</script>

<style lang="scss" scoped>
  .add {
    position: fixed;
    right: 40rpx;
    top: 750rpx;
    width: 108rpx;
    height: 108rpx;
  }
</style>
